#include "videothread.h"

VideoThread::VideoThread(cv::VideoCapture camera, QObject *parent) :
    QThread(parent)
{
    //this->videoThreadID = ID;
    this->cvCamera = camera;
}

void VideoThread::run()
{
    while(true)
    {
        matOriginal = new cv::Mat();

        cvCamera.read(*matOriginal);
        if(matOriginal->empty() == true) return;

        cv::cvtColor(*matOriginal, *matOriginal, CV_BGR2RGB);
        qimgOriginal = new QImage((uchar*)matOriginal->data, matOriginal->cols, matOriginal->rows, matOriginal->step, QImage::Format_RGB888);
        QThread::usleep(33333);

        emit ImageUpdate(*qimgOriginal);

    }

}

void VideoThread::addProcessedVideo(QString processingType)
{


}
